﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="ShowPhoto.aspx.cs" Inherits="Token.Piker.Web.Admin.NewsAlbum.ShowPhoto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>查看新闻图片</title>
    <style type="text/css">
        .img_holder {
            display: block;
            width: 200px;
            height: 200px;
            margin: 0 5px 5px 0;
            overflow: hidden;
            border: 1px solid #ccc;
        }
    </style>
    <script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("img.small_img").load(function () {
                var width = $(this).width();
                var height = $(this).height();
                var margintop = 100 - 1 / 2 * height;
                var marginleft = 100 - 1 / 2 * width;
                $(this).css("margin-top", margintop);
                $(this).css("margin-left", marginleft);
                $(this).css("margin-bottom", margintop);
                $(this).css("margin-right", marginleft);
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:DataList ID="datalist" runat="server" RepeatColumns="4" RepeatDirection="Horizontal"
        RepeatLayout="Table">
        <ItemTemplate>
            <div>
                <a href='<%# string.Format("PhotoDetails.aspx?ID={0}",Eval("ID")) %>' class="img_holder">
                    <img class="small_img" src="<%# ResolveClientUrl(string.Format("~/AJAX/Thumbnail.ashx?pid={0}&width=200&height=200&newsphoto=true",Eval("ID"))) %>" alt="" />
                </a>
            </div>
        </ItemTemplate>
    </asp:DataList>
</asp:Content>
